#include <gmDisplayObject>
#include <gmPoint.h>
#include <gmDMatrix.h>


 using namespace GMlib;
 using GMlib::DVector;
 using GMlib::DMatrix;
 using GMlib::SqMatrix;
 using GMlib::HqMatrix;

 class SweepSurface : public DisplayObject {

  public:
		SweepSurface();


  protected:
    void localDisplay();
    void localSelect();
    void localSimulate( double dt );
		void eval( double u, double v, int derivatives, Vector<double,3>& p);

  private:
    float     _size;
		Vector<double,3> _p;
    SqMatrix<double,3> _A;
    void makeRotationMatrix(double v, bool isInitFrame);
    void hfunc( double t, Vector<double,3> &p );
    void hderivative( double t, Vector<double,3> &p );
		void hderivative2( double t, Vector<double,3> &p );
    void gfunc( double t, Vector<double,3> &p );
		void gderivative( double t, Vector<double,3> &p );
		double gear(double t);

		enum curveType{helical, torus };
		curveType selectedCurve;

		Vector3D<double> _oldTangent;

    // Add following if you want to make the surroundingssphere visible
    // Sphere3D *_sphere;
 };
